#TO GENERATE FATA AND QUAL FILES

mkdir raw2
mv filesToRecall-*.zip raw2

cd raw2
unzip filesToRecall-*.zip
mv filesToRecall-*.zip ..

for i in `ls -A` ; do cp -f $i/*.phd.1 ../`grep $i ../recall.fullDirsToRecall` ; done

for i in `ls -A` ; do ls -1 $i/*.phd.1 >> $i.list ; done

mkdir processed
for i in `ls *.list`; do  phd2fasta -if $i `echo $i | perl -ne '/(P\dK-\d{5})\-([FR])_.\.list/; print "-os ./processed/$1.$2.fasta -oq ./processed/$1.$2.qual"'`; done

mv processed/* ../processed

cd ..
rm -rf raw2
rm -rf filesToRecall

"edit old output.txt file"

"redo generateLists.sh"
========================================================

for i in `ls -A`;do cp -af $i/*.phd.1 ../../`grep $i ../../recall.fullDirsToRecall` ; done
for i in `ls -A` ; do ls -1 $i/*.phd.1 >> $i.list ; done
mkdir processed
for i in `ls *.list`; do  phd2fasta -if $i `echo $i | perl -ne '/(P\dK-\d{5})\-([FR])_.\.list/; print "-os ./processed/$1.$2.fasta -oq ./processed/$1.$2.qual"'`; done
cp processed/* ../../processed/


===========================================================
./generateLists.sh

cp -ri files_to_copy/* /papaya/

cat all.sort.list new.sort.list | sort > all.sort.list.new
rm all.sort.list
mv all.sort.list.new all.sort.list 
